/**
 */
package js.phonegap.methods.impl;

import js.phonegap.methods.MethodsPackage;
import js.phonegap.methods.getCurrentPosition;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>get Current Position</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link js.phonegap.methods.impl.getCurrentPositionImpl#getTimeout <em>Timeout</em>}</li>
 *   <li>{@link js.phonegap.methods.impl.getCurrentPositionImpl#getMaximumAge <em>Maximum Age</em>}</li>
 *   <li>{@link js.phonegap.methods.impl.getCurrentPositionImpl#getEnableHighAccuracy <em>Enable High Accuracy</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class getCurrentPositionImpl extends PhonegapMethodImpl implements getCurrentPosition {
	/**
	 * The default value of the '{@link #getTimeout() <em>Timeout</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTimeout()
	 * @generated
	 * @ordered
	 */
	protected static final String TIMEOUT_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getTimeout() <em>Timeout</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTimeout()
	 * @generated
	 * @ordered
	 */
	protected String timeout = TIMEOUT_EDEFAULT;

	/**
	 * The default value of the '{@link #getMaximumAge() <em>Maximum Age</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMaximumAge()
	 * @generated
	 * @ordered
	 */
	protected static final String MAXIMUM_AGE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getMaximumAge() <em>Maximum Age</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMaximumAge()
	 * @generated
	 * @ordered
	 */
	protected String maximumAge = MAXIMUM_AGE_EDEFAULT;

	/**
	 * The default value of the '{@link #getEnableHighAccuracy() <em>Enable High Accuracy</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEnableHighAccuracy()
	 * @generated
	 * @ordered
	 */
	protected static final String ENABLE_HIGH_ACCURACY_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getEnableHighAccuracy() <em>Enable High Accuracy</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEnableHighAccuracy()
	 * @generated
	 * @ordered
	 */
	protected String enableHighAccuracy = ENABLE_HIGH_ACCURACY_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected getCurrentPositionImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return MethodsPackage.Literals.GET_CURRENT_POSITION;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getTimeout() {
		return timeout;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTimeout(String newTimeout) {
		String oldTimeout = timeout;
		timeout = newTimeout;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MethodsPackage.GET_CURRENT_POSITION__TIMEOUT, oldTimeout, timeout));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getMaximumAge() {
		return maximumAge;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMaximumAge(String newMaximumAge) {
		String oldMaximumAge = maximumAge;
		maximumAge = newMaximumAge;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MethodsPackage.GET_CURRENT_POSITION__MAXIMUM_AGE, oldMaximumAge, maximumAge));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getEnableHighAccuracy() {
		return enableHighAccuracy;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setEnableHighAccuracy(String newEnableHighAccuracy) {
		String oldEnableHighAccuracy = enableHighAccuracy;
		enableHighAccuracy = newEnableHighAccuracy;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MethodsPackage.GET_CURRENT_POSITION__ENABLE_HIGH_ACCURACY, oldEnableHighAccuracy, enableHighAccuracy));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case MethodsPackage.GET_CURRENT_POSITION__TIMEOUT:
				return getTimeout();
			case MethodsPackage.GET_CURRENT_POSITION__MAXIMUM_AGE:
				return getMaximumAge();
			case MethodsPackage.GET_CURRENT_POSITION__ENABLE_HIGH_ACCURACY:
				return getEnableHighAccuracy();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case MethodsPackage.GET_CURRENT_POSITION__TIMEOUT:
				setTimeout((String)newValue);
				return;
			case MethodsPackage.GET_CURRENT_POSITION__MAXIMUM_AGE:
				setMaximumAge((String)newValue);
				return;
			case MethodsPackage.GET_CURRENT_POSITION__ENABLE_HIGH_ACCURACY:
				setEnableHighAccuracy((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case MethodsPackage.GET_CURRENT_POSITION__TIMEOUT:
				setTimeout(TIMEOUT_EDEFAULT);
				return;
			case MethodsPackage.GET_CURRENT_POSITION__MAXIMUM_AGE:
				setMaximumAge(MAXIMUM_AGE_EDEFAULT);
				return;
			case MethodsPackage.GET_CURRENT_POSITION__ENABLE_HIGH_ACCURACY:
				setEnableHighAccuracy(ENABLE_HIGH_ACCURACY_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case MethodsPackage.GET_CURRENT_POSITION__TIMEOUT:
				return TIMEOUT_EDEFAULT == null ? timeout != null : !TIMEOUT_EDEFAULT.equals(timeout);
			case MethodsPackage.GET_CURRENT_POSITION__MAXIMUM_AGE:
				return MAXIMUM_AGE_EDEFAULT == null ? maximumAge != null : !MAXIMUM_AGE_EDEFAULT.equals(maximumAge);
			case MethodsPackage.GET_CURRENT_POSITION__ENABLE_HIGH_ACCURACY:
				return ENABLE_HIGH_ACCURACY_EDEFAULT == null ? enableHighAccuracy != null : !ENABLE_HIGH_ACCURACY_EDEFAULT.equals(enableHighAccuracy);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (timeout: ");
		result.append(timeout);
		result.append(", maximumAge: ");
		result.append(maximumAge);
		result.append(", enableHighAccuracy: ");
		result.append(enableHighAccuracy);
		result.append(')');
		return result.toString();
	}

} //getCurrentPositionImpl
